The overall goal of the present invention is to be able to render a three dimensional scene, in a computer graphics system, including polygons having lines drawn thereacross, by using a graphics adapter containing a Z-buffer. Generally, graphics adapters cause surface lines to have disappearing segments, due to insufficient data, as discussed in greater detail below.
The majority of graphics adapters include a Z-buffer which stores values relating to the depth of a picture element (pixel). Z-buffers provide for hidden surface removal, such that when the adapter is preparing to paint a pixel with a color, the Z-buffer can check to see if the pixel to be painted is at a depth greater (deeper) than the existing pixel displayed on the screen. If the pixel to be painted is deeper, then the adapter does nothing. Otherwise, it paints the pixel and updates the Z-buffer with the new depth value.
A problem exists when it is desired to paint a line upon the surface of a polygon. Mathematically, the line and surface are at the same depth. That is, the surface and the line have the same value stored in the Z-buffer. Errors occur because the line color is painted for some pixels, whereas the polygon surface color is painted for others. Further, the process used to paint the line is more accurate than the plurality of pixels provided on a display. Specifically, the line painting process is forced to use pixels not actually contained on the line, and since the normal to the surface upon which the line resides is unknown, the process must estimate the depth of the off-line pixels. Thus the line pixels, for which the process erroneously estimates the depth of the line to be deeper than the polygon surface, will seem to disappear.
It should be noted that it may be possible to associate a normal with any off-line pixels by making significant changes to the hardware design or microcode of the currently used graphics adapters. However, these types of changes would require retrofitting, or microcode reprogramming of each graphics adapter which would be an extremely time consuming and expensive process. Therefore, it would be very desirable to provide a software solution to the problems caused by these errors.